package com.wendellup.entity;




import java.util.List;

public class StudentDAOImpl implements IStudentDAO{
	public List<Student> queryAllStudent() throws Exception {
		List<Student> studentList = null;
		try {
			studentList = IbatisUtil.getClient().queryForList("selectAllStudent");
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return studentList;
	}
	
	public int addStudent(Student student) throws Exception {
		int key;
		try {
			key = (Integer) IbatisUtil.getClient().insert("insertStudent",student);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return key;
	}

}
